package com.gxa.meiye.portal.config;

import com.gxa.meiye.portal.interceptor.TokenInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author chen
 * @date 2022/7/7 11:35
 */

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    TokenInterceptor tokenInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(tokenInterceptor)
                .addPathPatterns("/locationcha/**")
                .addPathPatterns("/ordercha/**")
                .addPathPatterns("/comepay/**")
                .addPathPatterns("/order/**")
                .addPathPatterns("/shoppay/**")
                .addPathPatterns("/logout/**");
    }
}
